<%@ page language="java"  pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<title>沈阳外卖网</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<!-- Bootstrap -->
		<link href="publicui/bootstrap/css/bootstrap.min.css" rel="stylesheet"
			media="screen" />
		<!--[if lt IE 9]>
  <script src="public/js/html5shiv.js"></script>
<![endif]-->
		<!-- application  -->
		<link href="css/head.css" rel="stylesheet" />
		<link href="css/foot.css" rel="stylesheet" />
		<link href="css/feedback.css" rel="stylesheet" />
</head>

<body>

<!-----nav-->
<s:action name="top" executeResult="true"></s:action>
<!---/nav   -->

		<!---/body   -->
		<div class="content">
			<!--   content  -->
			<div class="feedback-wrapper bordered-box">
				<h2>
					我的留言&nbsp;&nbsp;
				</h2>
				<div class="feedback-content-wrapper">
					<ul>
					<s:if test="list!=null">
					<s:iterator id="l" value="%{list}">
						<li class="feedback_guest">
							<p>
								<s:property value="#l.message"/>
							</p>
							<p class="feedback-info">
								<span class="name"><s:property value="#session.user_session.username" /></span>
								<span class="time"><s:date name="#l.addTime" format="yyyy-MM-dd HH:ss"/></span>
								<!--   <a class="reply" href="/feedback/reply/id/19570">[回复]</a>-->
							</p>
						</li>
						<s:if test="#l.reply==null">
						<li class="feedback_admin admin_t">
							<p>
								暂无回复
							</p>
						</li>
						</s:if>
						<s:if test="#l.reply!=null">
						<li class="feedback_admin admin_t">
							<p>
								<s:property value="#l.reply"/>
							</p>

							<p class="feedback-info">
								<span class="name"> 管理员 </span>
								<span class="time"><s:date name="#l.replyTime" format="yyyy-MM-dd HH:ss"/></span>
							</p>
						</li>
						</s:if>
					</s:iterator>
					</s:if>
					</ul>
				</div>
				<!-- 
				<div class="pagination">
					<ul>
						<li class="prev disabled">
							<a href="#">&larr; 上一页</a>
						</li>
						<li class="active">
							<a href="/feedback?page=1">1</a>
						</li>
						<li>
							<a href="/feedback?page=2">2</a>
						</li>
						<li>
							<a href="/feedback?page=3">3</a>
						</li>
						<li>
							<a href="/feedback?page=4">4</a>
						</li>
						<li>
							<a href="/feedback?page=5">5</a>
						</li>
						<li>
							<a href="/feedback?page=6">6</a>
						</li>
						<li>
							<a href="/feedback?page=7">7</a>
						</li>
						<li>
							<a href="/feedback?page=8">8</a>
						</li>
						<li>
							<a href="/feedback?page=9">9</a>
						</li>
						<li>
							<a href="/feedback?page=10">10</a>
						</li>
						<li class="next">
							<a href="/feedback?page=2">下一页 &rarr;</a>
						</li>
					</ul>
				</div>
				-->
				<s:if test="#session.user_session!=null">
				<div class="feedback-form">
					<form method="post" action="userComment.action" id="myform">
					<input type="hidden" name="action" value="save"/>
					<!-- 
						<div class="control-group">
							<span class="required-mark">*</span> 留言类型：
							<label class="radio inline">
								<input type="radio" name="feedback[type]" value="1">
								催单
							</label>
							<label class="radio inline">
								<input type="radio" name="feedback[type]" value="2">
								网站错误
							</label>
							<label class="radio inline">
								<input type="radio" name="feedback[type]" value="3">
								功能建议
							</label>
							<label class="radio inline">
								<input type="radio" name="feedback[type]" value="4">
								投诉
							</label>
						</div>
						-->
						<textarea rows="5" cols="30" name="message" id="message" class="xxlarge" onkeydown="textCounter(this,500);"><s:property value="message"/></textarea>
						<div class="captcha-wrapper clearfix">
							<label>
								请输入验证码：
							</label>
							<input name="verifycode" id="verifycode" type="text" value="" size="5" maxlength="4" class="captcha"/>
							<a href='javascript:showAuthImg();' title='看不清，换一个'><img alt="验证码" src="/authimg" id="authimg" name="authimg" align="absmiddle" />
							</a>
						</div>

						<button type="submit" class="btn btn-yellow">
							发表留言
						</button>

					</form>

				</div>
				</s:if>
			</div>

			<!--   /content  -->
			<s:action name="foot" executeResult="true"></s:action>
		</div>
		

		<!---/body   -->

		<script src="publicui/js/jquery-1.8.3.js"></script>
		<script src="publicui/jquery-ui/js/jquery-ui-1.9.2.custom.js"></script>
		<script src="publicui/bootstrap/js/bootstrap.min.js"></script>
		<script src="js/head.js"></script>
		<script type="text/javascript">
		function textCounter(field,maxlimit) {   
			if (field.value.length > maxlimit){      
				field.value = field.value.substring(0, maxlimit);
				alert('留言不能超过'+maxlimit+'字');
			}   
		}
		function showAuthImg(){
			var url="/authimg?time="+new Date().getTime();
			$("#authimg").attr("src",url);
		}
		</script>
<s:if test="error!=null&&error!=''">
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">提示</h3>
  </div>
  <div class="modal-body">
    <p><s:fielderror><s:param>error</s:param></s:fielderror></p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
   <!-- <button class="btn btn-primary">确定 </button>   -->
  </div>
</div>
<script type="text/javascript"  >
$('#myModal').modal();
</script>
</s:if>
	</body>
</html>